<template>
	<div class="wdxq2" :style="{'min-height':Height-73+'px'}">
		<div class="wdxq_title flex align_center">
			<i class="el-icon-arrow-left" style="float: left;margin-left: 4%;font-size: 2.4rem;" @click="fh"></i>
			<span class="flex1">余额提现</span>
			<i class="el-icon-arrow-left" style="float: right;margin-right: 4%;font-size: 2.4rem;opacity: 0;"></i>
		</div>
		<div class="wdxq_div14">
			<p class="wdxq_div14p">提现金额</p>
			<input class="wdxq_div14input" type="number" placeholder="请输入提款金额" v-model="num"  />
			<div class="wdxq_div14d">
				可提现余额:<span>￥{{userMessagelist.balance}}</span>
			</div>
		</div>
		
		<div style="background: #fff;width: 100%;">
			<img src="../../../../static/img/images/yetx.jpg"  style="width: 90%;margin: 0 auto;display: block;"/>
		
		</div>
		
		<div class="wdxq_div" style="border: 0;width: 94%;padding: 0.7rem 3% 1rem 3%;background: #e7e9ee;">
			<el-button round style='color: #fff;background: #ff4242;width: 100%;font-size: 1.5rem;' @click='creatWithdrawals'>提交</el-button>
			<p style="color: #505050;font-size: 1.2rem;padding: 1rem 0;text-align: center;"><i class="el-icon-warning" style="margin-right: 0.5rem;"></i>预计24小时到账</p>
		
		</div>
	</div>
</template>

<script>
	import { Toast } from 'mint-ui';
	export default {
		data: function() {
			return {
				Height:0,
				tabI:0,
				div1left:[{
					'name':'本月',
					'i':0,
				},{
					'name':'上月',
					'i':1,
				},{
					'name':'全部',
					'i':2,
				}],
				num:'',

			}
		},
		mounted() {
			this.Height=document.body.offsetHeight;
		},
		methods: {
			fh(){
        		window.history.go(-1);
        	},
        	creatWithdrawals(){
        		if(this.num==0||this.num==''){
        			Toast('请输入提现金额');
        			return false;
        		}
        		if(this.num>parseFloat(this.userMessagelist.balance)){
        			Toast('提现金额不足');
        			return false;
        		}
        		this.$http.post(this.defines.creatWithdrawals, {
						uid: window.uid,
						money:this.num,
					}, {
						emulateJSON: true
					})
					.then(
						(data) => {
							if(data.data.success){
								this.fh();
							}
							else{
								Toast(data.data.errmsg);
							}
						},
						(error) => {
							console.log(error);
						}
					);
        	},
		}
	}
</script>

